package com.santu.edu.supporter.biz.user.pojo.dto;

import com.santu.edu.supporter.biz.user.pojo.params.UserAddressAddParam;
import com.santu.edu.supporter.biz.user.pojo.params.UserAddressUpdateParam;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 12158
 */
@Data
@Accessors(chain = true)
public class UserAddressDTO {

    /**
     * 地址id
     */
    private String addressId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 楼栋id
     */
    private String buildingsId;

    /**
     * 详细地址
     */
    private String addressInfo;

    /**
     * 收件人姓名
     */
    private String userName;

    /**
     * 收件人电话
     */
    private String phone;

    public static UserAddressDTO createItem(String userId,String addressId,UserAddressAddParam addParam) {
        return new UserAddressDTO()
                .setAddressId(addressId)
                .setUserId(userId)
                .setBuildingsId(addParam.getBuildingsId())
                .setAddressInfo(addParam.getAddressInfo())
                .setUserName(addParam.getUserName())
                .setPhone(addParam.getPhone());
    }


    public static UserAddressDTO createItem(String userId,UserAddressUpdateParam updateParam) {
        return new UserAddressDTO()
                .setAddressId(updateParam.getAddressId())
                .setUserId(userId)
                .setBuildingsId(updateParam.getBuildingsId())
                .setAddressInfo(updateParam.getAddressInfo())
                .setUserName(updateParam.getUserName())
                .setPhone(updateParam.getPhone());
    }



}
